pkgname=firmware-motorola-ocean
pkgver=5
pkgrel=0
pkgdesc="Firmware for Motorola Moto G7 Power"
url="https://gitlab.com/Ultra-azu/firmware-motorola-ocean"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
_commit="787dcae00d0866079c6f55dc3ddf6592279b0661"
source="
	https://gitlab.com/Ultra-azu/firmware-motorola-ocean/-/archive/$_commit/firmware-motorola-ocean-$_commit.tar.gz
	moto-modem-rfs-setup.initd
	$pkgname-openrc.post-install
"
subpackages="$pkgname-openrc"

builddir="$srcdir/$pkgname-$_commit/lib/firmware/postmarketos"
_fwdir="/lib/firmware"

package() {
	install -Dm755 $srcdir/moto-modem-rfs-setup.initd "$pkgdir"/etc/init.d/moto-modem-rfs-setup

	install -Dm644 a506_zap.b02 -t "$pkgdir/$_fwdir/qcom/msm8953/motorola/ocean"
	install -Dm644 a506_zap.mdt -t "$pkgdir/$_fwdir/qcom/msm8953/motorola/ocean"

	install -Dm644 wlan/prima/WCNSS_qcom_cfg.ini -t "$pkgdir/$_fwdir/postmarketos/wlan/prima"
	install -Dm644 wlan/prima/WCNSS_qcom_wlan_nv.bin -t "$pkgdir/$_fwdir/postmarketos/wlan/prima"
}

openrc() {
	install="$subpkgname.post-install"
	default_openrc
}

sha512sums="
fd0888bb6a0beeca961d9aabd0e60be64dfd841c3c89c7cdb8e7c1284347c4f56b2bad6a73aebc81e86625a4b548b5d2417ca31de6803ea5b3b58c7c1d97be51  firmware-motorola-ocean-787dcae00d0866079c6f55dc3ddf6592279b0661.tar.gz
d4fd0f3406c9f004e9cae7bc500c5713aab75f102f8e3ea1af820865f01eb03def01cd9ed3e8a184c7dfc22ab419628fad17957a3782885d96eb36e94461e842  moto-modem-rfs-setup.initd
784ac120a2231cfbee153fb8b2634af4ab5091eaa8fe207e66b47641d7531591ee3849e610bb66c7177822c86556f78d51c17ba8e4f3da2f946c4b8c5eaaf310  firmware-motorola-ocean-openrc.post-install
"
